package com.mzj.saas.rent;


import com.haixiaoke.saas.repository.core.AjaxResult;
import com.haixiaoke.saas.repository.core.BaseController;
import com.haixiaoke.saas.repository.pojo.HotAttractions;
import com.haixiaoke.saas.repository.service.IHotAttractionsService;
import com.haixiaoke.saas.repository.util.Tree.Node;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 热门景点Controller
 *
 * @author qixi
 * @date 2023-04-06
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/hot/attractions")
public class HotAttractionsController extends BaseController {

    private final IHotAttractionsService hotAttractionsService;

    /**
     * 查询热门景点列表
     */
    @GetMapping("/list")
    public AjaxResult list(HotAttractions hotAttractions) {
        List<HotAttractions> list = hotAttractionsService.selectHotAttractionsList(hotAttractions);
        return AjaxResult.success(list);
    }


    /**
     * 根据城市 id 查询热门景点列表
     */
    @GetMapping("/comboList/{cityId}")
    public AjaxResult comboList(@PathVariable Long cityId) {
        List<Node> list = hotAttractionsService.selectComboListByCityId(cityId);
        return AjaxResult.success(list);
    }


}
